ποΈGitΠ―ΡΠ°ποΈ
docs/en/developer/persistence.md 4d4070c8e1ed73a56ee2f054300a0f62e3fe2e62 (4d4070c8) Text, 3.28 KB
title: Persistence
parent: Developer Guide
nav_order: 6
last_updated: 2026-07-08
aliases:
β’ room
β’ database
β’ datastore
β’ prefs
Persistence
How the Meshtastic app stores data across different mechanisms.
Room KMP Database
Module: T383838core:database
The primary structured data store:
β’ Node information and history
β’ Message history
β’ Waypoints
β’ Telemetry data
β’ Channel configurations
Key Points
β’ Uses Room KMP for cross-platform compatibility
β’ Migrations managed through Room's built-in migration system
β’ DAO interfaces live in T383838core:database
β’ Repository layer in T383838core:repository provides the public API
β’ Full-text message search is backed by an FTS5 content table (T383838PacketFts) over T383838Packet, kept in sync by Room-managed triggers
What's Stored in Room
ββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Entity β Description β
ββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β T383838NodeEntity β All known mesh nodes and their metadata β
β T383838MyNodeEntity β The local node's own info β
β T383838Packet β Message history (channel and direct), waypoints, and telemetry dβ¦ β
β T383838PacketFts β FTS5 virtual table mirroring T383838Packet.messageText for full-text meβ¦ β
β T383838ContactSettings β Per-contact mute and read-state β
β T383838ReactionEntity β Emoji reactions on messages β
β T383838MeshLog β Raw mesh protocol logs β
β T383838MetadataEntity β Device metadata (firmware version, hardware model) β
β T383838QuickChatAction β User-configured quick-chat messages β
β T383838DeviceHardwareEntity β Cached device hardware catalog β
β T383838FirmwareReleaseEntity β Cached firmware release info β
β T383838TracerouteNodePositionEntity β Traceroute hop position data β
β T383838DiscoverySessionEntity β A Local Mesh Discovery scan session (timestamp, presets scanned,β¦ β
β T383838DiscoveryPresetResultEntity β Per-preset result within a discovery session β
β T383838DiscoveredNodeEntity β Nodes found during a discovery preset scan β
β T383838DeviceLinkEntity β Cached T383838msh.to device links from the Meshtastic API β
ββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π‘ Note: Waypoints, telemetry, and channel data are stored within the T383838Packet entity (using the
β T383838port_num field to distinguish packet types) rather than in separate tables.
DataStore Preferences
Module: T383838core:datastore
For lightweight key-value preferences:
β’ Local radio configuration (LocalConfig proto)
β’ Module configuration (ModuleConfig proto)
β’ Channel set data
β’ Local statistics
β’ Recently connected device addresses
Core Prefs
Module: T383838core:prefs
Higher-level preferences abstraction:
β’ User-facing settings
β’ App behavior configuration
β’ Feature toggles
What Docs Intentionally Skip
The T383838feature:docs module uses no Room or persistent database. Documentation ships as build-time assets versioned with the app binary, so it stays fully offline, is replaced on each update, and needs no migration story. Optional UX state (e.g. last viewed page) could live in T383838core:prefs but isn't part of the docs data model.
Best Practices
β’ Use Room for structured, queryable data that changes at runtime
β’ Use DataStore for simple preferences and state
β’ Use bundled resources/assets for static content
β’ Never store sensitive data (keys, passwords) in plain Room tables
β’ Always provide migrations for schema changes
Served by rngit 1.5.0 - Generated in 0.04s